import { defineStore } from 'pinia'
import { ref } from 'vue'
import type { PromptConfig } from '@/types/app'

export const useAppStore = defineStore('app', () => {
  // 状态
  const promptConfig = ref<PromptConfig | null>(null)
  const appInfo = ref({
    title: '智能对话助手',
    description: '基于Vue 3 + TypeScript的智能对话应用',
    version: '1.0.0'
  })

  // 方法
  const setPromptConfig = (config: PromptConfig) => {
    promptConfig.value = config
  }

  const setAppInfo = (info: any) => {
    appInfo.value = { ...appInfo.value, ...info }
  }

  const resetApp = () => {
    promptConfig.value = null
  }

  return {
    // 状态
    promptConfig,
    appInfo,
    
    // 方法
    setPromptConfig,
    setAppInfo,
    resetApp
  }
}) 